﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Design;

namespace STKMIS
{
    public class DataGridViewMCComboxColumn : DataGridViewColumn
    {
         private object m_dataSoruce = null;

         public DataGridViewMCComboxColumn()
             : base(new DataGridViewMCComboxCell())
         {



         } 

        public override DataGridViewCell CellTemplate
        {
            get
            {
                return base.CellTemplate;
            }
            set
            {
                if (value != null && !value.GetType().IsAssignableFrom(typeof(DataGridViewMCComboxCell)))
                {
                    throw new InvalidCastException("不是DataGridViewDataWindowCell");
                }
                base.CellTemplate = value; 
            }
        }
        private DataGridViewMCComboxCell ComboBoxCellTemplate
        {
            get
            {
                return (DataGridViewMCComboxCell)this.CellTemplate;
            }
        }
        public  Object dataSource
        {
            get
            {
                return m_dataSoruce;

            }
            set
            {
                if (ComboBoxCellTemplate != value)
                {
             
                    m_dataSoruce = value;
                }
            }
        }

        private List<ComboxGridViewColumns> _grvColumnsList;
        /// <summary>
        /// 显示列表参数
        /// </summary>
        public List<ComboxGridViewColumns> GrvColumnsList
        {
            get { return _grvColumnsList; }
            set { _grvColumnsList = value; }
        }

        private bool _isShowEvent = false;
        /// <summary>
        /// 是否显示事件
        /// </summary>
        public bool IsShowEvent
        {
            get { return _isShowEvent; }
            set { _isShowEvent = value; }
        }

        private string _keyWordsColumn = "";
        /// <summary>
        /// 关键字列
        /// </summary>
        public string KeyWordsColumn
        {
            get { return _keyWordsColumn; }
            set { _keyWordsColumn = value; }
        }
        private string _displayMemberColumn = "";
        /// <summary>
        /// 显示列
        /// </summary>
        public string DisplayMemberColumn
        {
            get { return _displayMemberColumn; }
            set { _displayMemberColumn = value; }
        }

        private string _valueMemberColumn = "";
        /// <summary>
        /// 值列
        /// </summary>
        public string ValueMemberColumn
        {
            get { return _valueMemberColumn; }
            set { _valueMemberColumn = value; }
        }
    }
}
